{extend name="admin@index_layout"/}
{block name="main"}
<form class="layui-form" method="post">
    <input name="id" type="hidden" value="{$data.id}">
<!--    <input type="hidden" name="row[id]" value="{$data.id}">-->
    <div class="layui-form-item">
        <label class="layui-form-label" style="color: red;font-weight: bold;!important;">所属员工</label>
        <div class="layui-input-block">
            <input type="text" name="row2[salesperson]" autocomplete="off" placeholder="所属员工" class="layui-input"
                   value="{$data.salesperson}">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">店铺名称</label>
        <div class="layui-input-block">
            <input type="text" name="row[shop_name]" autocomplete="off" placeholder="店铺名称" class="layui-input"
                   value="{$data.shop_name}">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">身份证</label>
        <div class="layui-input-block">
            <input type="text" name="row[sf_id]" autocomplete="off" placeholder="身份证" class="layui-input"
                   value="{$data.sf_id}">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">店铺联系人</label>
        <div class="layui-input-block">
            <input type="text" name="row[people]" autocomplete="off" placeholder="店铺联系人" class="layui-input"
                   value="{$data.people}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">联系电话</label>
        <div class="layui-input-block">
            <input type="text" name="row[phone]" autocomplete="off" placeholder="联系电话" class="layui-input"
                   value="{$data.phone}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">省</label>
        <div class="layui-input-block">
            <select name="row[province]" lay-verify="required" lay-filter="ccc62">
                <option value="">请选择省</option>
                {volist name="proviec" id="vo"}
                <!--                <option  value="{$key.id}"  name="row[operate_type]">{$key.name}</option>-->
                <option value="{$vo.name}"
                <?php if( $vo['name'] == $data['province']){ ?> selected <?php }?>>{$vo.name}</option>
                {/volist}
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">市</label>
        <div class="layui-input-block">
            <select id="c-city" name="row[city]" lay-verify="required" lay-filter="c-city">
                <option value="">请选择市</option>
                {volist name="city_list" id="vo"}
                <option value="{$vo.name}"
                <?php if( $vo['name'] == $data['city']){ ?> selected <?php }?>>{$vo.name}</option>
                {/volist}
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">区</label>
        <div class="layui-input-block">
            <select id="c-city2" name="row[area]" lay-filter="c-city2">
                <option value="">请选择区</option>
                {volist name="area_list" id="vo"}
                <option value="{$vo.name}"
                <?php if( $vo['name'] == $data['area']){ ?> selected <?php }?>>{$vo.name}</option>
                {/volist}
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">详情地址</label>
        <div class="layui-input-block">
            <input type="text" name="row[address]" autocomplete="off" placeholder="详情地址:xx路xx号" class="layui-input"
                   value="{$data.address}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">身份证1</label>
        <div class="layui-input-block">
            <div class="w300">
                <input value="{$data.sf_img1}" type="text" lay-verify="required" name="row[sf_img1]"
                       id="c-pic56"
                       class="layui-input">
            </div>
            <button type="button" class="layui-btn faupload" id="faupload-pic56" data-multiple="false"
                    data-input-id="c-pic56"
                    data-preview-id="p-pic56" data-type="image"><i class="layui-icon layui-icon-upload"></i> 上传
            </button>
            <button type="button" class="layui-btn fachoose" data-multiple="false" data-mimetype="image"
                    data-input-id="c-pic56" id="fachoose-c-pic56"><i class="iconfont icon-other"></i> 选择
            </button>
            <ul class="layui-row list-inline plupload-preview" id="p-pic56"></ul>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">身份证2</label>
        <div class="layui-input-block">
            <div class="w300">
                <input value="{$data.sf_img2}" type="text" lay-verify="required" name="row[sf_img2]"
                       id="c-pic7"
                       class="layui-input">
            </div>
            <button type="button" class="layui-btn faupload" id="faupload-pic7" data-multiple="false"
                    data-input-id="c-pic7"
                    data-preview-id="p-pic7" data-type="image"><i class="layui-icon layui-icon-upload"></i> 上传
            </button>
            <button type="button" class="layui-btn fachoose" data-multiple="false" data-mimetype="image"
                    data-input-id="c-pic7" id="fachoose-c-pic7"><i class="iconfont icon-other"></i> 选择
            </button>
            <ul class="layui-row list-inline plupload-preview" id="p-pic7"></ul>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">店铺门头图片</label>
        <div class="layui-input-block">
            <div class="w300">
                <input value="{$data.shop_img}" type="text" lay-verify="required" name="row[shop_img]"
                       id="c-pic3"
                       class="layui-input">
            </div>
            <button type="button" class="layui-btn faupload" id="faupload-pic2" data-multiple="false"
                    data-input-id="c-pic3"
                    data-preview-id="p-pic3" data-type="image"><i class="layui-icon layui-icon-upload"></i> 上传
            </button>
            <button type="button" class="layui-btn fachoose" data-multiple="false" data-mimetype="image"
                    data-input-id="c-pic3" id="fachoose-c-pic2"><i class="iconfont icon-other"></i> 选择
            </button>
            <ul class="layui-row list-inline plupload-preview" id="p-pic3"></ul>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">人证合一照片</label>
        <div class="layui-input-block">
            <div class="w300">
                <input value="{$data.rz_img}" type="text" lay-verify="required" name="row[rz_img]"
                       id="c-pic5"
                       class="layui-input">
            </div>
            <button type="button" class="layui-btn faupload" id="faupload-pic5" data-multiple="false"
                    data-input-id="c-pic5"
                    data-preview-id="p-pic5" data-type="image"><i class="layui-icon layui-icon-upload"></i> 上传
            </button>
            <button type="button" class="layui-btn fachoose" data-multiple="false" data-mimetype="image"
                    data-input-id="c-pic5" id="fachoose-c-pic5"><i class="iconfont icon-other"></i> 选择
            </button>
            <ul class="layui-row list-inline plupload-preview" id="p-pic5"></ul>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">手机串码截图</label>
        <div class="layui-input-block">
            <div class="w300">
                <input value="{$data.jq_img}" type="text" lay-verify="required" name="row[jq_img]"
                       id="c-pic4"
                       class="layui-input">
            </div>
            <button type="button" class="layui-btn faupload" id="faupload-pic4" data-multiple="false"
                    data-input-id="c-pic4"
                    data-preview-id="p-pic4" data-type="image"><i class="layui-icon layui-icon-upload"></i> 上传
            </button>
            <button type="button" class="layui-btn fachoose" data-multiple="false" data-mimetype="image"
                    data-input-id="c-pic4" id="fachoose-c-pic4"><i class="iconfont icon-other"></i> 选择
            </button>
            <ul class="layui-row list-inline plupload-preview" id="p-pic4"></ul>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">承诺书</label>
        <div class="layui-input-block">
            <div class="w300">
                <input value="{$data.cn_img}" type="text" lay-verify="required" name="row[cn_img]"
                       id="c-pic8"
                       class="layui-input">
            </div>
            <button type="button" class="layui-btn faupload" id="faupload-pic8" data-multiple="false"
                    data-input-id="c-pic8"
                    data-preview-id="p-pic8" data-type="image"><i class="layui-icon layui-icon-upload"></i> 上传
            </button>
            <button type="button" class="layui-btn fachoose" data-multiple="false" data-mimetype="image"
                    data-input-id="c-pic8" id="fachoose-c-pic8"><i class="iconfont icon-other"></i> 选择
            </button>
            <ul class="layui-row list-inline plupload-preview" id="p-pic8"></ul>
        </div>
    </div>




    <div class="layui-form-item">
        <label class="layui-form-label">审核状态</label>
        <div class="layui-input-block" id="is_c3">

            <input type="radio" name="row[status]" value="0" title="待审核" {if $data.status==0}checked{/if}
                   lay-filter="ccc3">

            <input type="radio" name="row[status]" value="1" title="审核通过" {if $data.status==1}checked{/if}
                   lay-filter="ccc3">

            <input type="radio" name="row[status]" value="2" title="账户冻结" {if $data.status==2}checked{/if}
                   lay-filter="ccc3">

            <input type="radio" name="row[status]" value="3" title="审核失败" {if $data.status==3}checked{/if}
                   lay-filter="ccc3">
        </div>
    </div>

    <div class="layui-form-item r1">
        <label class="layui-form-label">审核失败原因</label>
        <div class="layui-input-block">
            <input type="text" name="row[reason_refusal]" autocomplete="off" placeholder="审核失败原因" class="layui-input"
                   value="{$data.reason_refusal}">
        </div>
    </div>



    <div class="layui-form-item layer-footer">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit>提交</button>
        </div>
    </div>
</form>
{/block}
{block name="script"}
<script type="text/javascript">
    layui.use(['yznForm', 'laydate', 'form'], function () {
        var yznForm = layui.yznForm,
            laydate = layui.laydate;
        var form = layui.form;
        // laydate = layui.laydate;
        var $ = layui.jquery;

        yznForm.bindevent($("form.layui-form"));
        // laydate.render({
        //     elem: '#ID-laydate'
        // });
        laydate.render({
            elem: '#ID-laydate'
        });
        form.on('select(ccc6)', function (data) {
            console.log(data.value);
            if (data.value == 3) {
                $(".c5").show();
            } else {
                $(".c5").hide();
            }
            form.render();
        });
        form.on('select(ccc62)', function (data) {
            console.log(data.value);
            $.ajax({
                type: "POST",//规定传输方式
                url: "{:url('getc_cate')}",//提交URL
                data: {'id': data.value},//提交的数据
                success: function (result) {
                    if (result.code == 200) {
                        $("#c-city").empty();
                        var str = "<option value>请选择市</option>";
                        $.each(result.data, function (i, val) {
                            str += '<option value=' + val.name + '>' + val.name + '</option>'
                        });
                        $("#c-city").append(str);

                        $("#c-city2").empty();
                        var str2 = "<option value>请选择区</option>";
                        $("#c-city2").append(str2);

                        layui.form.render('select');
                    }
                },
                error: function () {
                    alert("获取信息失败")
                }
            });
            form.render();
        });

        form.on('select(c-city)', function (data) {
            $.ajax({
                type: "POST",//规定传输方式
                url: "{:url('getc_cate')}",//提交URL
                data: {'id': data.value},//提交的数据
                success: function (result) {
                    if (result.code == 200) {

                        $("#c-city2").empty();
                        var str = "<option value>请选择区</option>";
                        $.each(result.data, function (i, val) {
                            str += '<option value=' + val.name + '>' + val.name + '</option>'
                        });
                        $("#c-city2").append(str);
                        layui.form.render('select');
                    }
                },
                error: function () {
                    alert("获取信息失败")
                }
            });
            form.render();
        });
    });
</script>
{/block}